package hu.cskassai.sad.model.core.hibernate;

import java.util.UUID;

import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.PrePersist;

import org.hibernate.annotations.Type;

import hu.cskassai.sad.model.core.UuidIdentifiable;

@MappedSuperclass
public class AbstractUuidIdentifiable extends AbstractIdentifiable<UUID> implements UuidIdentifiable {
	
	protected AbstractUuidIdentifiable() {
		super();
		id = UUID.randomUUID();
	}
	
	@Access(AccessType.PROPERTY)
	@Id
	@Type(type = "uuid-char")
	@Column(length = 36)
	public UUID getId() {
		return super.getId();
	}
	
	public void setId(final UUID id) {
		super.setId(id);
	}
	
	
	
}
